{ include file='../Common/head_category.html' }
<body>
<div class="container-fluid">
    <table class="table table-hover">
        <thead>
        <tr>
            <th>文章标题</th>
            <th>时间</th>
            <th>管理操作</th>
        </tr>
        </thead>
        { foreach from="$data" item="v" }
        <tr>
            <td class="col-sm-5 col-md-7 col-lg-7">{$v.title}</td>
            <td class="col-sm-4 col-md-3 col-lg-3">{$v.sendtime|date_format:'%m-%d %H:%M'}</td>
            <td class="col-sm-3 col-md-2 col-lg-2">
                <a href="{$smarty.const.__APP__}?c=Article&m=edit&aid={$v.aid}" class="btn btn-success btn-xs">修改</a>
                <button type="button" onclick="category_del('{$v.aid}')" class="btn btn-danger btn-xs">删除</button>
            </td>
        </tr>
        { /foreach }
    </table>
</div>
{literal}
<script type="text/javascript">
    function category_del(aid){
        if(confirm("确定删除该文章吗？")){
            location.href = "./admin.php?c=Article&m=del&aid="+aid;
        }
    }
</script>
{/literal}
</body>
</html>